﻿using System;

class DecimalAsHexadecimal
{
    static void Main()
    {
        int decimalNumber = 123123;
        string result = "";
        while (decimalNumber != 0)
        {
            result += TurnNumberInLetters((decimalNumber % 16).ToString());
            decimalNumber /= 16;
        }
        char[] reversedArray = result.ToCharArray();
        Array.Reverse(reversedArray);
        result = new string(reversedArray);
        Console.WriteLine(result);
    }

    private static string TurnNumberInLetters(string str)
    {
        switch (str)
        {
            case "10":
                str = "a";
                break;
            case "11":
                str = "b";
                break;
            case "12":
                str = "c";
                break;
            case "13":
                str = "d";
                break;
            case "14":
                str = "e";
                break;
            case "15":
                str = "f";
                break;
        }
        return str;
    }
}